package com.supreme.studyserver.service.mall;

import java.util.Arrays;
import java.util.Objects;

public enum EnumMallType {

    TBM("天猫", "TBM"),
    JDM("京东", "JDM"),
    PDD("拼多多", "PDD"),
    DYM("抖音", "DYM"),
    ELM("饿了么", "ELM"),
    MET("美团", "MET"),
    JDD("京东到家", "JDD"),
    ;

    private final String label;

    private final String value;

    EnumMallType(String label, String value) {
        this.label = label;
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public String getValue() {
        return value;
    }

    public static EnumMallType findByValue(String value) {
        return Arrays.stream(EnumMallType.values())
                .filter(enumMallType -> Objects.equals(enumMallType.value, value))
                .findAny()
                .orElse(null);
    }
}
